#include <rviz/display.h>
#include <OgreSceneNode.h>
#include <OgreSceneManager.h>

namespace my_namespace
{
class MyDisplay : public rviz::Display
{
public:
  MyDisplay()
  {
    ROS_INFO("MyDisplay Plugin Created");
  }

  ~MyDisplay() override
  {
    ROS_INFO("MyDisplay Plugin Destroyed");
  }

protected:
  void onInitialize() override
  {
    ROS_INFO("Initializing MyDisplay");
    scene_node_ = scene_manager_->getRootSceneNode()->createChildSceneNode();
  }

  void onEnable() override
  {
    ROS_INFO("Enabling MyDisplay");
  }

  void onDisable() override
  {
    ROS_INFO("Disabling MyDisplay");
    scene_node_->setVisible(false);
  }

private:
  Ogre::SceneNode* scene_node_;
};
} // namespace my_namespace

#include <pluginlib/class_list_macros.h>
PLUGINLIB_EXPORT_CLASS(my_namespace::MyDisplay, rviz::Display)
